import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import HomeView from '../views/HomeView.vue';
;
import NewsView from '../views/NewsView.vue';
import NewsDetailView from '../views/NewsDetailView.vue';
import Auth from '../components/Auth.vue';
import CreateArticleView from '../views/CreateArticleView.vue';
import NonMemberApplicationView from '../views/NonMemberApplicationView.vue';
import MemberApplicationView from '../views/MemberApplicationView.vue';
import MinorMemberApplicationView from '../views/MinorMemberApplicationView.vue';
import UserProfile from '../views/UserProfile.vue';
import MatchRecordView from'../views/MatchRecordView.vue'
import MatchRecordViewDetail from '../views/MatchRecordViewDetail.vue';
import AdultMemberManagementView from '../views/AdultMemberManagementView.vue';
import MinorMemberManagementView from '../views/MinorMemberManagementView.vue';
const routes = [
  { 
    path: '/', 
    name: 'Home', 
    component: HomeView,
    meta: { 
      breadcrumb: '首页', 
      icon: 'home' // 添加图标标识符
    } 
  },
  { 
    path: '/news', 
    name: 'News', 
    component: NewsView,
    meta: { 
      parent: 'Home',
      breadcrumb: '公告列表', 
      icon: 'news' // 添加图标标识符
    } 
  },
  { 
    path: '/news/:id', 
    name: 'NewsDetail', 
    component: NewsDetailView,
    meta: { 
      breadcrumb: '公告详情', 
      parent: 'News',
      icon: 'detail' // 添加图标标识符
    } 
  },
  { 
    path: '/auth', 
    name: 'Auth', 
    component: Auth,
    meta: { 
      parent: 'Home',
      breadcrumb: '登录', 
      icon: 'login' // 添加图标标识符
    } 
  },
  { 
    path: '/create_news', 
    name: 'CreateNews', 
    component: CreateArticleView,
    meta: { 
      breadcrumb: '创建公告', 
      parent: 'Home',
      icon: 'create' // 添加图标标识符
    } 
  },
  { 
    path: '/non_member_application', 
    name: 'NonMemberApplication', 
    component: NonMemberApplicationView,
    meta: { 
      breadcrumb: '非玩家会员申请', 
      parent: 'Home',
      icon: 'application' // 添加图标标识符
    } 
  },
  { 
    path: '/member_application', 
    name: 'MemberApplication', 
    component: MemberApplicationView,
    meta: { 
      breadcrumb: '玩家会员申请', 
      parent: 'Home',
      icon: 'application' // 添加图标标识符
    } 
  },
  { 
    path: '/minor_member_application', 
    name: 'MinorMemberApplication', 
    component: MinorMemberApplicationView,
    meta: { 
      breadcrumb: '未成年人会员申请', 
      parent: 'Home',
      icon: 'application' // 添加图标标识符
    } 
  },
  {
    path: '/user_profile',
    name: 'UserProfile',
    component: UserProfile, 
    meta: { 
      breadcrumb: '用户主页', 
      parent: 'Home',
      icon: 'user' // 添加图标标识符
    }, 
  },
  {
    path: '/match_record',
    name: 'MatchRecord',
    component: MatchRecordView,
    meta: { 
      breadcrumb: '比赛记录', 
      parent: 'Home',
      icon: 'match' // 添加图标标识符
    }
  },
  {
    path: '/match_record/:matchId',
    name: 'MatchRecordDetail',
    component: MatchRecordViewDetail,
    meta: { 
      breadcrumb: '比赛详情', 
      parent: 'MatchRecord',
      icon: 'detail' // 添加图标标识符
    },
  },
  {
    path: '/adult_member_management',
    name: 'AdultMemberManagement',
    component: AdultMemberManagementView,
    meta: { 
      breadcrumb: '成年会员管理', 
      parent: 'memberManagement',
      icon: 'user' // 使用用户图标标识符
    }
  },
  {
    path: '/minor_member_management', // 新增路由路径
    name: 'MinorMemberManagement', // 新增路由名称
    component: MinorMemberManagementView, // 新增组件引用
    meta: { 
      breadcrumb: '未成年会员管理', 
      parent: 'memberManagement', 
      icon: 'user' 
    }
  },
];
const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
